﻿<UserControl x:Class="SimCityPak.ViewRW4"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                     xmlns:rw="clr-namespace:SporeMaster.RenderWare4"
             xmlns:simCityPak="clr-namespace:SimCityPak"
             mc:Ignorable="d" 
             d:DesignHeight="500" d:DesignWidth="600" DataContextChanged="UserControl_DataContextChanged">
    <Grid >
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="280" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <TextBlock HorizontalAlignment="Left" Margin="0,4,0,0" Name="textBlock1" Text="Sections:" VerticalAlignment="Top" />
        <DataGrid AutoGenerateColumns="False" IsReadOnly="true"   Margin="0,27,11,179" Name="dataGrid1" SelectionChanged="dataGrid1_SelectionChanged" SelectionMode="Single" HorizontalGridLinesBrush="#FFA3A3A3" VerticalGridLinesBrush="#FFA3A3A3">
            <DataGrid.Columns>
                <DataGridTextColumn  Binding="{Binding Number}" Header="Number"/>
                <DataGridTemplateColumn Header="TypeCode" Width="*" >
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding DisplayName}"   />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
               <!-- <DataGridTextColumn Binding="{Binding Pos}" Header="Pos" />
                <DataGridTextColumn Binding="{Binding Size}" Header="Size" />
                <DataGridTextColumn Binding="{Binding Alignment}" Header="Alignment" />-->
            </DataGrid.Columns>
        </DataGrid>
        <GridSplitter Width="5" />
        <TabControl  Name="tabControl1" Grid.Column="1">
            <TabItem Header="Context View" Name="tablControlThing">
                <Grid>
                    <ContentControl Name="viewContainer">
                        <ContentControl.ContentTemplateSelector>
                            <simCityPak:RW4ViewSelector />
                        </ContentControl.ContentTemplateSelector>
                        <ContentControl.Resources>
                            <DataTemplate DataType="{x:Type rw:RW4Section}" x:Key="viewVertexArray">
                                <simCityPak:ViewVertexArray DataContext="{Binding Section}" />
                            </DataTemplate>
                            <DataTemplate DataType="{x:Type rw:RW4Section}" x:Key="viewMaterial">
                                <simCityPak:ViewMaterial DataContext="{Binding Section}" />
                            </DataTemplate>
                            <DataTemplate DataType="{x:Type rw:RW4Section}" x:Key="viewVertexFormat">
                                <simCityPak:ViewVertexFormat DataContext="{Binding Section}" />
                            </DataTemplate>
                            <DataTemplate DataType="{x:Type rw:RW4Section}" x:Key="viewTexture">
                                <simCityPak:ViewTexture DataContext="{Binding Section}" />
                            </DataTemplate>
                            <DataTemplate DataType="{x:Type rw:RW4Section}" x:Key="viewData">
                                <simCityPak:ViewHex DataContext="{Binding Section}" />
                            </DataTemplate>
                            <DataTemplate DataType="{x:Type rw:RW4Section}" x:Key="viewMesh">
                                <simCityPak:ViewMesh />
                            </DataTemplate>
                        </ContentControl.Resources>
                    </ContentControl>
                </Grid>
            </TabItem>
            <TabItem Header="Hex View">
                <simCityPak:ViewHex x:Name="viewHex" DataChangedHandler="viewHex_DataChangedHandler" />                
            </TabItem>
        </TabControl>
        <Grid Height="135" Margin="0,0,0,38" Name="gridHeaderDetails" VerticalAlignment="Bottom">
            <TextBlock HorizontalAlignment="Left" Margin="166,0,0,113" Name="txtHeaderSectionBegin" Text=""  Height="16" VerticalAlignment="Bottom" Width="103" />
            <TextBlock Height="16" HorizontalAlignment="Left" Margin="6,0,0,113" Text="Section Index Begin:" VerticalAlignment="Bottom" Width="154" />
            <TextBlock Height="16" HorizontalAlignment="Left" Margin="166,0,0,91" Name="txtHeaderPadder" Text="" VerticalAlignment="Bottom" Width="103" />
            <TextBlock Height="16" HorizontalAlignment="Left" Margin="6,0,0,91" Text="Section Index Padding:" VerticalAlignment="Bottom" Width="154" />
            <TextBlock Height="16" HorizontalAlignment="Left" Margin="166,0,0,69" Name="txtHeaderEnd" Text="" VerticalAlignment="Bottom" Width="103" />
            <TextBlock Height="16" HorizontalAlignment="Left" Margin="6,0,0,69" Text="Section Index End:" VerticalAlignment="Bottom" Width="154" />
            <TextBlock Height="16" HorizontalAlignment="Left" Margin="166,0,0,47" Name="txtHeaderEndPos" Text="" VerticalAlignment="Bottom" Width="103" />
            <TextBlock Height="16" HorizontalAlignment="Left" Margin="6,0,0,47" Text="Header End:" VerticalAlignment="Bottom" Width="154" />
        </Grid>
    </Grid>
</UserControl>
